﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld" %>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>
  
  <div class="container main-content">

    <div class="panel panel-default x-panel x-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/online-rounds">打卡管理</a></li>
          <li class="active">课程管理</li>
          <li class="no-before pull-right" style="min-width: 65px;">
            <a onclick="window.history.back();"><i class="glyphicon glyphicon-arrow-left"></i>&nbsp;&nbsp;返回</a>
          </li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 x-panel-layout-right">

          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire" title="分组模板详情"></i>&nbsp;&nbsp;<span>课程管理&nbsp;-&nbsp;详情</span></h2>
            </div>
          </div>
          
          <div class="x-breadcrumb-wrapper top-margin-20" style="position: relative;">
            <ul class="nav nav-pills x-breadcrumb-nav">
              <li class="pull-left"><a href="${ctx.host}/market-courses/${marketCourse.id}">基本信息</a></li>
              <li class="pull-left active"><a href="${ctx.host}/market-courses/${marketCourse.id}/monthly-coursewares/1/batch-coursewares/1">课件</a></li>
              <div class="pull-right" style="margin-top:10px;">
                <a href="${ctx.host}/market-courses/${marketCourse.id}/monthly-coursewares/${months}/batch-coursewares/${batchCoursewareTemplate.id}/edit" data-target="#info-edit" data-toggle="modal" title="编辑">编辑</a>
              </div>
            </ul>
          </div>
          
          <div class="clearfix">
          
          <div class="row" >
          
            <div class="col-xs-1 template-submenu">
              <ul class="nav nav-pills nav-stacked template-list">
                <c:forEach var="monthly" items="${persist.marketMonthlyCoursewareTemplate(marketCourse.id)}">
                  <li class="submenu text-center ${months == monthly.sorting ? 'active' : ''}"><a href="${ctx.host}/market-courses/${marketCourse.id}/monthly-coursewares/${monthly.sorting}/batch-coursewares/1" >${monthly.name}</a></li>
                </c:forEach>
              </ul>
            </div>
          
            <div class="col-xs-2 template-submenu">
              <ul class="nav nav-pills nav-stacked template-list">
                <c:forEach var="batch" items="${persist.marketBatchCoursewareTemplate(monthlyCoursewareTemplate.id)}">
                  <li class="submenu text-center ${weeks == batch.sorting ? 'active' : ''}"><a href="${ctx.host}/market-courses/${marketCourse.id}/monthly-coursewares/${monthlyCoursewareTemplate.sorting}/batch-coursewares/${batch.sorting}" >${batch.name}</a></li>
                </c:forEach>
              </ul>
            </div>
            
            <div class="col-xs-7">
            
              <div class="schedule-action-layout">
                <c:forEach var="daily" items="${persist.marketDailyCoursewareTemplate(batchCoursewareTemplate.id)}">
                  <div class="action-module">
                    <label class="text-right">${daily.name}:<br/>
                      <a href="${ctx.host}/market-courses/${marketCourse.id}/monthly-coursewares/${monthlyCoursewareTemplate.sorting}/batch-coursewares/${batchCoursewareTemplate.id}/daily-coursewares/${daily.id}/edit" data-toggle="modal" data-target="#daily-edit">修改</a>
                    </label>
                    <c:set var="coursewareTemplates" value="${persist.marketCoursewareTemplate(daily.id)}"/>
                    <c:choose>
                      <c:when test="${empty coursewareTemplates}">
                        <div class="compile-action text-center">
                          <a href="${ctx.host}/market-courses/${marketCourse.id}/monthly-coursewares/${monthlyCoursewareTemplate.sorting}/batch-coursewares/${batchCoursewareTemplate.id}/daily-coursewares/${daily.id}/coursewares/create" class="btn btn-default btn-shadow-default" data-toggle="modal" data-target="#create">添加动作</a>
                        </div>
                      </c:when>
                      <c:otherwise>
                        <div class="compile-action clearfix">
                          <div class="row" style="min-height:20px;">
                            <label class="text-left">所有动作：</label>
                            <div class="action-item">
                              <c:forEach var="courseware" items="${coursewareTemplates}">
                                <div class="action-layout">
                                  <a href="${ctx.host}/market-courses/${marketCourse.id}/monthly-coursewares/${monthlyCoursewareTemplate.sorting}/batch-coursewares/${batchCoursewareTemplate.id}/daily-coursewares/${daily.id}/coursewares/${courseware.id}/edit" class="add-action" data-toggle="modal" data-target="#edit">
                                    <div class="action-cover">
                                      <img src="${cloud.prod}/${courseware.movement.cover}-0.6" alt="">
                                      <p>${courseware.movement.name}</p>
                                    </div>
                                    <p>${courseware.actDescription}</p>
                                  </a>
                                  <a href="${ctx.host}/market-courses/${marketCourse.id}/monthly-coursewares/${monthlyCoursewareTemplate.sorting}/batch-coursewares/${batchCoursewareTemplate.id}/daily-coursewares/${daily.id}/coursewares/${courseware.id}/delete" class="close-module" data-toggle="modal" data-target="#delete"></a>
                                </div>
                              </c:forEach>
                              <div class="action-layout">
                                <a href="${ctx.host}/market-courses/${marketCourse.id}/monthly-coursewares/${monthlyCoursewareTemplate.sorting}/batch-coursewares/${batchCoursewareTemplate.id}/daily-coursewares/${daily.id}/coursewares/create" class="add-module" data-toggle="modal" data-target="#create">
                                  <div class="action-add">
                                    <img src="${ctx.resource}/images/add.png" alt="">添加动作
                                  </div>
                                </a>
                              </div>
                            </div>
                          </div>
                        </div>
                      </c:otherwise>
                    </c:choose>
                  </div>
                </c:forEach>
              </div>
              
            </div>
            
          </div>
          </div>
          
        </div>
          
        </div>

      </div>

    </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/market/batch-courseware-index.js">
    <script type="text/javascript">
      require(['page/market/batch-courseware-index'], function(page) {
        page.init()
      })
    </script>
  </d:resource>
  
</body>

</html>
